﻿package com.guavestudios.fnfo.plugins 
{
	import com.guavestudios.fnfo.plugins.BasicFnfoPlugin;
	import flash.events.Event;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	
	/**
	 * ...
	 * @author maze | ppmcity.com
	 */
	public class BasicTextDataDisplay extends BasicFnfoPlugin
	{
		
		protected var textDisplay:TextField;
		
		public function BasicTextDataDisplay() {
			super();
			_pluginId = "BasicTextDataDisplay";
		}
		
		override protected function fnfo_initialize(e:Event):void {
			super.fnfo_initialize(e);
			
			textDisplay = new TextField();
			textDisplay.autoSize = TextFieldAutoSize.LEFT;
			textDisplay.defaultTextFormat = new TextFormat("Verdana", 12,0xAAAAAA);
			_fnfo.addChild(textDisplay);
		}
		
		override protected function fnfo_display_data(e:Event):void {
			super.fnfo_display_data(e);
			var _infoList:Array = _fnfo.infoList;
			
			var ob:Object;
			for (var i:int = 0,ilen:int=_infoList.length; i < ilen; i++) {
				ob = _infoList[i];
				textDisplay.appendText(ob.desc + ": " + ob.value + "\n");
			}
		}
		
	}

}